<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>ElementUI</title>
        <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    </head>
    <body>
        <div id="app">
            <el-table :data="tableData" stripe height="285" style="width: 100%">
                <el-table-column prop="no" label="编号" width="80">
                </el-table-column>
                <el-table-column prop="name" label="姓名" width="180">
                </el-table-column>
                <el-table-column prop="job" label="职位" width="180">
                </el-table-column>
                <el-table-column prop="sal" label="月薪" width="180">
                </el-table-column>
            </el-table>
        </div>
        <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.min.js"></script>
        <script src="https://unpkg.com/element-ui/lib/index.js"></script>
        <script>
            let app = new Vue({
                el: '#app',
                data: {
                    tableData: []
                },
                created() {
                    fetch('http://localhost:5000/api/emps?size=10')
                        .then(resp => resp.json())
                        .then(json => {
                            this.tableData = json.employees
                        })
                }
            })
        </script>
    </body>
</html>